%include header.html posts=posts,BLOG_NAME=BLOG_NAME,allcates=allcates, SUBTITLE=SUBTITLE
<!-- start page -->
<div id="main">
  <!-- start content -->
  <div id="content">
		%import re
			%id = posts.get('_id')
			%title=posts.get('title')
			%author = posts.get('author')
			%content = posts.get('content')
			%if posts.get('categories'):
				%cates = ''
					%for cate in posts.get('categories'):
						%c = '<a  href="/categories/'+str(cate.get('_id'))+'/">'+cate.get('name')+'</a>,'
						%cates += c
					%end
				%categories = cates[0:-1]
			%else:
				%categories = '<a href="/categories/nocategorie">未分类</a>'
			%end
			%ts = ''
			%for tag in posts.get('tags'):
				%t = '<a  href="/tags/'+tag+'">'+tag+'</a>,'
				%ts += t
			%end
			%tags = ts[0:-1]
			%comm_num = posts['comments']
		    %date = posts['date']
		    %views = posts['views']
		<!-- start post -->
		<div class="post">
		  <!-- start title -->
		  <div class="title">
			<h2><a href="/archrives/{{id}}">{{title}}</a></h2>
				<p>
				  <small>
					Posted on {{date}} by 
					<a href="/author/{{author}}">{{author}}</a> {{views}} views
				</small>
				</p>
		  </div>
		  <!-- end title -->
		  <div class="entry">
			{{!content}}
		  </div>
		  
		  <br />
		  <div class="footer">
			<p><small>Posted in {{!categories}} | Tagged {{!tags}}</small></p>
		  </div>
		</div>
		<!-- end post -->
		<!-- start comments -->
		<div id="comments">
		  <a name="comments"></a>
		  <div class="title">
			评论
		  </div>
		  %for comment in comments:
		  <!-- start comment -->
		  <div class="comment">
			<strong>
			  <a href="http://{{comment.get('website')}}">{{comment['name']}}</a>
			</strong>&nbsp;在 {{comment['date']}} 评论:
			<p>
			  {{comment['content']}}
			</p>
		  </div>
		  <!-- end comment -->
		  %end
		</div>
		<!-- end comments -->
		<a name="subcomment"></a>
		<!-- start submit commit -->
		<div class="comment_frame">
		  <form action="/comments/post" method="post">
			尊姓大名:<input type="text" name="name" />
			<small>* 必须,不然不知道如何称呼您</small><br />
			邮箱地址:<input type="text" name="email" />
			<small>* 必须,放心绝不和第二个人说</small><br />
			个人网站:<input type="text" name="website" />
			<small>* 必须,好让我去仰慕下您</small><br />
			留言:<br />
			<textarea cols="60" rows="10" name="content"></textarea>
			<small>* 必须,不然您这是要闹哪样</small>	<br />
			<input type="hidden" name="artid" value="{{id}}" />
			<input type="submit" name="submit" value="提交" />
		  </form>
		</div>
	<!-- end submit commit -->
  </div>
  <!-- end content -->
    %include sidebar.html allcates=allcates, toptenart=toptenart, dates=dates
</div>
<!-- end main -->
<br style="clear: both;" />

<!-- end page -->
%include footer.html
</body>
</html>
